import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BillManager billManager = new BillManager(scanner); // 将Scanner对象传递给BillManager
        boolean running = true;//nothing

        while (running){
            System.out.println("=====================");
            System.out.println("====个人账单管理系统====");//修改正确
            System.out.println("\t"+"1.记录收入金额");
            System.out.println("\t"+"2.记录支出金额");
            System.out.println("\t"+"3.显示个人账单");
            System.out.println("\t"+"4.查询个人账单");
            System.out.println("\t"+"5.设置月度预算");
            System.out.println("\t"+"6.显示剩余预算");
            System.out.println("\t"+"7.月度账单统计");
            System.out.println("\t"+"8.退出账单管理系统");
            System.out.println("=====================");
            System.out.println("=====================");
            System.out.println("请选择：");
            int option = scanner.nextInt();
            scanner.nextLine();

            switch (option) {
                case 1: // 记录收入
                    billManager.recordIncome();
                    break;

                case 2: // 记录支出
                    billManager.recordExpense();
                    break;

                case 3: // 显示个人账单
                    billManager.displayTransactions();
                    break;

                case 4: // 查询个人账单
                    billManager.queryTransactions();
                    break;

                case 5://设置月度预算
                    billManager.setMonthlyBudget();
                    break;

                case 6://显示剩余预算
                    billManager.displayRemainingBudget();
                    break;

                case 7://月度账单统计
                    billManager.displayMothlyStatistics();
                    break;

                case 8:
                    running = false;
                    System.out.println("感谢使用个人账单管理系统，再见！");
                    break;

                default:
                    System.out.println("请重新输入你的选择！");
                    break;
            }
            System.out.println("按任意键返回主菜单...");
            scanner.nextLine();
        }
        scanner.close();
    }
}